<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="com.iMusic.businessLogicLayer.Account" %>
<%@ page import="com.iMusic.businessLogicLayer.Product" %>
<%@ page import="com.iMusic.businessLogicLayer.Order" %>
<%@ page import="com.iMusic.businessLogicLayer.CustomerReport" %>
<%@ page import="com.iMusic.businessLogicLayer.ProductPerCustomerReport" %>
<%@ page import="com.iMusic.businessLogicLayer.VipConsumption" %>
<%@ page import="com.iMusic.businessLogicLayer.BestSaleProduct" %>
<%@ page import="com.iMusic.businessLogicLayer.FinancialReports" %>
<%@ page import="com.iMusic.businessLogicLayer.Feedback" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<head>
<script>
function formatDollar(num) {
    var p = num.toFixed(2).split(".");
    return "$" + p[0].split("").reverse().reduce(function(acc, num, i, orig) {
        return  num + (i && !(i % 3) ? "," : "") + acc;
    }, "") + "." + p[1];
}
function validateForm1(num)
{
var Name = "Name_"+num; 
 
var x=document.forms["ManageInventory"][Name].value;
 
if (x==null || x=="")
  {
  alert("Name must be filled out.");
  return false;
  }
  
var Description = "Description_"+num;  
 
var x=document.forms["ManageInventory"][Description].value;
if (x==null || x=="")
  {
  alert("Description must be filled out.");
  return false;
  }  

var Type = "Type_"+num;    
var x=document.forms["ManageInventory"][Type].value;
if (x==null || x=="")
  {
  alert("Type must be chosen.");
  return false;
  }
var Category = "Category_"+num;   
var x=document.forms["ManageInventory"][Category].value;
if (x==null || x=="")
  {
  alert("Category must be chosen.");
  return false;
  }
  
var Price = "Price_"+num;   
var x=document.forms["ManageInventory"][Price].value;
if (x==null || x=="")
  {
  alert("Price must be filled out.");
  return false;
  }
var pricePattern = /^[1-9][0-9]*\.[0-9]{2}$/;

 
if (!pricePattern.test(x))
{
alert("Only numbers are accepted for the Price. For Example 7.99.");
return false;
}
var UnitsInStock = "UnitsInStock_"+num;   
var x=document.forms["ManageInventory"][UnitsInStock].value;
if (x==null || x=="")
  {
  alert("Units In Stock must be filled out.");
  return false;
  }
var stockPattern = new RegExp("^[0-9]+$");
if (!stockPattern.test(x))
{
alert("Only numbers are accepted for Units In Stock.");
return false;
  
} 
}


function validateForm()
{
 
var x=document.forms["ManageInventory"]["Name_"].value;
if (x==null || x=="")
  {
  alert("Name must be filled out.");
  return false;
  }

var x=document.forms["ManageInventory"]["Description_"].value;
if (x==null || x=="")
  {
  alert("Description must be filled out.");
  return false;
  }
  
var x=document.forms["ManageInventory"]["Type_"].value;
if (x==null || x=="")
  {
  alert("Type must be chosen.");
  return false;
  }
  
var x=document.forms["ManageInventory"]["Category_"].value;
if (x==null || x=="")
  {
  alert("Category must be chosen.");
  return false;
  }
  
var x=document.forms["ManageInventory"]["Price_"].value;
if (x==null || x=="")
  {
  alert("Price must be filled out.");
  return false;
  }
var pricePattern = /^[1-9][0-9]*\.[0-9]{2}$/;

 
if (!pricePattern.test(x))
{
alert("Only numbers are accepted for the Price. For Example 7.99.");
return false;
}

var x=document.forms["ManageInventory"]["UnitsInStock_"].value;
if (x==null || x=="")
  {
  alert("Units In Stock must be filled out.");
  return false;
  }
var stockPattern = new RegExp("^[0-9]+$");
if (!stockPattern.test(x))
{
alert("Only numbers are accepted for Units In Stock.");
return false;
}


}
</script>

<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>iMusic</title>

<script src="SortTable/sorttable.js" type="text/javascript"></script>


</head>
<body onLoad='initTable("ProdPerCust");'>
<%
String error=request.getParameter("error");
if(error==null || error=="null"){
 error="";
}

String error2 = (String) request.getSession().getAttribute("Error");
if(error2==null || error2=="null"){
	 error2="";
	}


%>
<%
if (!error2.equals("")) {
%>
	<div style="text-align: right; color: rgb(255, 0, 0);"><%=error2%></div>
<%
}
%>	

<%
	String action = (String) request.getParameter("action");

	if (action == null || action == "null") {
		action = null;
	}
	
	if (request.getSession().getAttribute("Staff") == null) {
%>		
	<script type="text/javascript">
		window.parent.location = "default.jsp";
	</script>
<%     
		
	}
		
	if (request.getSession().getAttribute("Staff") != null && action != null && action.equals("ProcessOrders")) {
%>

		<table style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<tbody>
		
		<form style="vertical-align: middle; text-align: center; " target="_top" name="UpdateOrders" action="UpdateOrders" method="post" >
		
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>ACCOUNT</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>ORDER ID</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>DATE</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>PAID</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>STATUS</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>LAST<br>MODIFIED</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>AMOUNT</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>TRACKING<br>NUMBER</b>
				</td>
			</tr>
		
		
			<c:forEach items="${Staff.searchOpenOrders()}" var="order">
				<tr>
					<td style="vertical-align: top; width: 100px;"><br>
			            ${order.getAccount().getUsername()}
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			            ${order.getOrderId()}
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			        	${order.getDateCreated()} 
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			        	<c:if test="${order.isPaid() }" >
			        		Yes
			        	</c:if> 
			        	<c:if test="${!order.isPaid() }">
			        		No
			        	</c:if> 
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
					
					    <select name="status_${order.getOrderId() }">
      					<option value="-1" selected>${order.getStatus().getName()}</option>
      					<option value="1">Cancelled</option>
      					<option value="2">In Progress</option>
      					<option value="3">Shipped</option>
      					<option value="4">Delivered</option>
      					</select>
			        	 
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			        	${order.getDateModified()} 
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			        	<fmt:formatNumber value="${order.getTotal() }" type="currency"/> 
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			        	<input value="${order.getTrackingNumber()}" type="text" name="TN_${order.getOrderId()}"/> 
			        </td>
			    </tr>    
			</c:forEach>

			<tr>	
				<td></td>
				<td></td>
				<td></td>
				<td>	
				<br>
				<input value="Submit Changes" type="submit">
				</td>
			</tr>
		</form>
		</tbody>
		</table>
		<br>
<%
	}
%>

<%
	if (request.getSession().getAttribute("Staff") != null && action != null && action.equals("ManageInventory")) {
%>

		<i>Select a product to update, or</i>
		<form style="vertical-align: middle; " target="_top" action="adminFS.jsp?action=AddNewProduct" method="post" name="AddNewProduct">
			<input value="Add New Product" type="submit">
		</form>
		<br>
		
		<table style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<tbody>
		
			<tr>
				<td style="vertical-align: top; width: 300px;"><br>
					<b>PRODUCT</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>PRICE<br> PER UNIT</b>
				</td>
				<td style="vertical-align: top; width: 100px;"><br>
					<b>UNITS<br>IN STOCK</b>
				</td>
				<td style="vertical-align: top; width: 100px;">
				</td>
			</tr>
		
		
			<c:forEach items="${Staff.getInventory().getAllProducts()}" var="prod">
				<tr>
					<td style="vertical-align: top; width: 300px;"><br>
			            <b> ${prod.getName()}</b>&nbsp(${prod.getTypeName()})&nbsp<br>
			            <i>${prod.getCategoryName()}</i><br>
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			        	 <fmt:formatNumber value="${prod.getPrice()}" type="currency"/>
			        </td>
					<td style="vertical-align: top; width: 100px;"><br>
			            <c:if test="${prod.getUnitsInStock() >= 0}"> 
			        	 	${prod.getUnitsInStock()}
			            </c:if>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	<form style="vertical-align: middle; " target="_top" action="adminFS.jsp?action=Update_${prod.getProductId() }" method="post" name="Update_${prod.getProductId()}">
							<input value="Update" type="submit">
						</form>
			        </td>
			    </tr>    
			</c:forEach>

		</tbody>
		</table>
		<br>
<%
	}
%>


<%
	if (request.getSession().getAttribute("Staff") != null && action != null && action.startsWith("Update_")) {
%>

		<%
			Integer prodId = Integer.parseInt(action.substring(action.indexOf('_')+1,action.length()));
			Product prod = Product.getProduct(null, prodId);
		%>

		<i>Update product details, or</i>
		<form style="vertical-align: middle; " target="_top" action="ManageInventory" method="post" name="DeleteProduct_<%=prodId%>">
			<input type="hidden" name="DeleteProduct_<%=prodId %>">
			<input value="Delete this Product" type="submit">
		</form>
		<br>

		<table style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<tbody>
		
		<form style="vertical-align: middle; " target="_top" action="ManageInventory" method="post" name="ManageInventory" onsubmit="return validateForm1(<%=prodId%>)">
		
				
			<tr>
			
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Name:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="<%=prod.getName() %>" size=20
						maxlength=20 name="Name_<%=prod.getProductId() %>">
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Description:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="<%=prod.getDescription() %>" size=50 
						maxlength=50 name="Description_<%=prod.getProductId() %>">
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Type:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<select name="Type_<%=prod.getProductId()%>">
      					<option value="<%=prod.getTypeName() %>" selected><%=prod.getTypeName() %></option>
      					<option value="Vinyl">Vinyl</option>
      					<option value="Collection of Vinyls">Collection of Vinyls</option>
      					<option value="CD - Album">CD - Album</option>
      					<option value="CD - Selection of MP3 songs">CD - Selection of MP3 songs</option>
      					<option value="Collection of CDs">Collection of CDs</option>
      					<option value="MP3 download - single song">MP3 download - single song</option>
      					<option value="MP3 download - album">MP3 download - album</option>
      					<option value="MP3 download - Collection">MP3 download - Collection</option>
      					<option value="DVD - live performance">DVD - live performance</option>
      					<option value="Collection of DVDs">Collection of DVDs</option>
      				</select>
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Category:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<select name="Category_<%=prod.getProductId()%>">
      					<option value="<%=prod.getCategoryName() %>" selected><%=prod.getCategoryName() %></option>
      					<option value="Rock">Rock</option>
      					<option value="Jazz">Jazz</option>
      					<option value="Pop">Pop</option>
      					<option value="Disco">Disco</option>
      					<option value="Country">Country</option>
      					<option value="Alternative">Alternative</option>
      					<option value="Dance">Dance</option>
      					<option value="Electronic">Electronic</option>
      				</select>		        
      			</td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Price: $
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="<%=prod.getPrice() %>" name="Price_<%=prod.getProductId()%>">
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Units in Stock:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="<%=prod.getUnitsInStock() %>" name="UnitsInStock_<%=prod.getProductId()%>"><br>
					<i>This will be ignored if the Product Type is an MP3.</i>
		        </td>
		    </tr> 
		    <tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input value="Update" type="submit">
				</td>
			</tr>
			
		</form>
		       
		</tbody>
		</table>
		<br>
		
<%
	}
%>


<%
	if (request.getSession().getAttribute("Staff") != null && action != null && action.startsWith("AddNewProduct")) {
%>

		<table style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<tbody>
		
		<form style="vertical-align: middle; " target="_top" action="ManageInventory" method="post" name="ManageInventory" onsubmit="return validateForm()">
		
		<%
			Integer prodId = -1;
		%>
			
			<tr>
			
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Name:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="" size=20
						maxlength=20 name="Name_">
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Description:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="" size=50 
						maxlength=50 name="Description_">
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Type:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<select name="Type_">
      					<option value="" selected></option>
      					<option value="Vinyl">Vinyl</option>
      					<option value="Collection of Vinyls">Collection of Vinyls</option>
      					<option value="CD - Album">CD - Album</option>
      					<option value="CD - Selection of MP3 songs">CD - Selection of MP3 songs</option>
      					<option value="Collection of CDs">Collection of CDs</option>
      					<option value="MP3 download - single song">MP3 download - single song</option>
      					<option value="MP3 download - album">MP3 download - album</option>
      					<option value="MP3 download - Collection">MP3 download - Collection</option>
      					<option value="DVD - live performance">DVD - live performance</option>
      					<option value="Collection of DVDs">Collection of DVDs</option>
      				</select>
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Product Category:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<select name="Category_">
      					<option value="" selected></option>
      					<option value="Rock">Rock</option>
      					<option value="Jazz">Jazz</option>
      					<option value="Pop">Pop</option>
      					<option value="Disco">Disco</option>
      					<option value="Country">Country</option>
      					<option value="Alternative">Alternative</option>
      					<option value="Dance">Dance</option>
      					<option value="Electronic">Electronic</option>
      				</select>
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Price: $
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="" name="Price_">
		        </td>
			</tr>
			<tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        	 Units in Stock:
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input type="text" value="" name="UnitsInStock_"><br>
					<i>This will be ignored if the Product Type is an MP3.</i>
		        </td>
		    </tr> 
		    <tr>
				<td style="vertical-align: top; width: 100px;"><br>
		        </td>
				<td style="vertical-align: top; width: 300px;"><br>
					<input value="Add Product" type="submit">
				</td>
			</tr>
			
		</form>
		       
		</tbody>
		</table>
		<br>
<%
	}
%>

<%
	if (request.getSession().getAttribute("Staff") != null && action != null && action.equals("FinancialReporting")) {
%>

		<b> ACCOUNTING / FINANCIAL REPORTING </b><br>
		<br>
		<i>Select a date interval:</i> <br><br>
		<form style="vertical-align: middle; " target="_top" action="GenerateFinancialReports" method="post" name="GenerateFinancialReports">
		
		From:	<input name="StartDate" type="date"> &nbsp&nbsp&nbsp To: <input name="EndDate" type="date">
		&nbsp&nbsp&nbsp<input value="Generate Financial Report" type="submit">
		</form>
		<br>

		<%
		FinancialReports financialReports = (FinancialReports) request.getSession().getAttribute("FinancialReports");
		if (financialReports != null) {
		%>
		
		<i><b>Accounting</b></i>
		
		<table id="FinReport" border=2 class="sortable" style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<thead>
		
			<tr>
				<th >
					<b>Account Number</b>
				</th>
				<th >
					<b>Credit / Debit</b>
				</th>
				<th >
					<b>Date</b>
				</th>
				<th >
					<b>Amount</b>
				</th>
			</tr>
		</thead>
		<%
			for (FinancialReports.Accounting item : financialReports.getAccounting()) {
		%>
				<tr>
					<td style="vertical-align: top; width: 100px;">
						<%=item.getAccountNumber() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%= item.getCreditDebit() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%= item.getDateCreated() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	$<%= item.getAmount() %>
			        </td>
			    </tr>    
		<%
			}
		%>
		</table>
		
		<i>
		Account Number: <br>
		&nbsp&nbsp Rxxxxxxxxx Revenue <br>
		&nbsp&nbsp Sxxx&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Shipping <br>
		&nbsp&nbsp Fxxx&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Federal Tax <br>
		&nbsp&nbsp Pxxx&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Provincial Tax <br>
		
		</i>
		
		<br>
		
		
		
	<%
		request.getSession().removeAttribute("FinancialReports");
		}
	}
	%>




<%
	if (request.getSession().getAttribute("Staff") != null && action != null && action.equals("CustomerReporting")) {
%>

		<b> CUSTOMER REPORTING </b><br>
		<br>
		<i>Select a date interval (YYYY-MM-DD):</i> <br><br>
		<form style="vertical-align: middle; " target="_top" action="GenerateCustomerReport" method="post" name="GenerateCustomerReport">
		
		From:	<input name="StartDate" type="date"> &nbsp&nbsp&nbsp To: <input name="EndDate" type="date">
		&nbsp&nbsp&nbsp<input value="Generate Customer Reports" type="submit">
		</form>
		<br>
		
		<%
		CustomerReport customerReport = (CustomerReport) request.getSession().getAttribute("CustomerReport");
		if (customerReport != null) {
		%>
		
		<i><b>Report 1 - Products sold</b></i>
		
		<table id="ProdPerCust" border=2 class="sortable" style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<thead>
		
			<tr>
				<th >
					<b>Age</b>
				</th>
				<th >
					<b>Gender</b>
				</th>
				<th >
					<b>Username</b>
				</th>
				<th >
					<b>VIP</b>
				</th>
				<th >
					<b>Total<br>Sales</b>
				</th>
				<th style="vertical-align: top; width: 200px;">
					<b>Product<br>Type</b>
				</th>
				<th >
					<b>Product<br>Category</b>
				</th>
				<th >
					<b>Quantity</b>
				</th>
			</tr>
		</thead>
		<%
			for (ProductPerCustomerReport item : customerReport.getProdPerCust()) {
		%>
				<tr>
					<td style="vertical-align: top; width: 100px;">
						<%=item.getAge() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%= item.getSex() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%= item.getUsername() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	<%= item.getVip() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	$<%= item.getPrice() %>
			        </td>
			        <td style="vertical-align: middle; width: 200px;">
			        	<%= item.getTypeName() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	<%= item.getCategoryName() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	<%= item.getCountItems() %>
			        </td>
			    </tr>    
		<%
			}
		%>
		</table>
		<br>
		
		
		
		<i><b>Report 2 - Best Sale Products</b></i>
		
		<table id="BestSaleProducts" border=2 class="sortable" style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<thead>
		
			<tr>
				<th >
					<b>Product ID</b>
				</th>
				<th >
					<b>Product Name</b>
				</th>
				<th style="vertical-align: middle; width: 200px;">
					<b>Product Type</b>
				</th>
				<th >
					<b>Product Category</b>
				</th>
				<th >
					<b>Quantity</b>
				</th>
				<th >
					<b>Total<br>Sales</b>
				</th>
			</tr>
		</thead>
		<%
			for (BestSaleProduct item : customerReport.getBestSaleProduct()) {
		%>
				<tr>
					<td style="vertical-align: top; width: 100px;">
						<%=item.getProductId() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%= item.getProductName() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%= item.getTypeName() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	<%= item.getCategoryName() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	<%= item.getCountItems() %>
			        </td>
			        <td style="vertical-align: middle; width: 100px;">
			        	$<%=item.getPrice() %>
			        </td>
			    </tr>    
		<%
			}
		%>
		</table>
		<br>
		
		
		
		
		
		<i><b>Report 3 - Customer Feedback</b></i>
		
		<table id="Feedbacks" border=2 class="sortable" style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<thead>
		
			<tr>
				<th >
					<b>Date</b>
				</th>
				<th >
					<b>Feedback</b>
				</th>
			</tr>
		</thead>
		
		<%
			for (Feedback item : customerReport.getFeedbacks()) {
		%>
				<tr>
					<td style="vertical-align: top; width: 100px;">
						<%=item.getDateCreated() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%=item.getDescription() %>
			        </td>
				</tr>
		<%
			}
		%>
		
		</table>
		<br>
		
		
		<i><b>Report 4 - VIP Consumption</b></i>
		
		<table id="VipConsumption" border=2 class="sortable" style="text-align: left; width: 100%; height: 100%;" border="0"
		cellpadding="2" cellspacing="2">
		<thead>
		
			<tr>
				<th >
					<b>Username</b>
				</th>
				<th >
					<b>Quantity</b>
				</th>
				<th >
					<b>Total<br>Sales</b>
				</th>
			</tr>
		</thead>
		<%
			for (VipConsumption item : customerReport.getVipConsumption()) {
		%>
				<tr>
					<td style="vertical-align: top; width: 100px;">
						<%=item.getUsername() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						<%= item.getCountItems() %>
			        </td>
					<td style="vertical-align: top; width: 100px;">
						$<%= item.getPrice() %>
			        </td>
			    </tr>    
		<%
			}
		%>
		</table>
		<br>
		
		
		
		
	<%
		request.getSession().removeAttribute("CustomerReport");

		}
	}
	%>



</body>
</html>